#ifndef PAGEWHEELSET_H
#define PAGEWHEELSET_H

#include <QWidget>
#include <QEvent>
#include <QLineEdit>
#include <QKeyEvent>
#include <QRegExp>
#include <QRegExpValidator>
#include <QTimer>
#include <QLabel>
#include "numberkeyboard.h"
#include "global_def.h"

namespace Ui {
class PageWheelSet;
}

class PageWheelSet : public QWidget
{
    Q_OBJECT

public:
    explicit PageWheelSet(QWidget *parent = nullptr);
    ~PageWheelSet();
    void setPageActive(bool xActive);
    void setProWheelValue(uint8_t index, uint8_t value);
    void setBrkWheelValue(uint8_t index, uint8_t value);
    uint8_t getProWheelInputValue(uint8_t index);
    uint8_t getBrkWheelInputValue(uint8_t index);
protected:
     bool eventFilter(QObject *obj, QEvent *event);
signals:
    void returnToMaintMenu();
    void signal_ProWheelSetValid(bool);
    void signal_BrkWheelSetValid(bool);
private slots:
    void input_slot(int);
    void backspace_slot();
    void cancel_slot();
    void on_Btn_Return_clicked();
    void on_Btn_Confirm_TRAC_clicked();
    void on_Btn_Confirm_BRK_clicked();

private:
    Ui::PageWheelSet *ui;
private:
    NumberKeyBoard *m_pNumKeyBoard;
    QList<QLineEdit *> inputlist;
    QLineEdit *m_pFocusLinedit=NULL;
    QList<QLabel* > m_lProWheelList;
    QList<QLabel* > m_lBrkWheelList;
};

#endif // PAGEWHEELSET_H
